<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ include file="../common.jsp" %>
<script type="text/javascript">
	$(document).ready(function(){
	 setWorkFlowURL('<c:out value="${flowExecutionUrl}" />');
	 submitDialog();
	 openRemarksDialog();			 
	 setDialogDiv("remarksDiv");
	 var actionType = '<c:out value="${workflowActionType}" />';
	 if(actionType && actionType.indexOf("approve",0) != -1){
		 $("#remarksDiv").dialog("option","title","Submit Document");
	 }else {
		 $("#remarksDiv").dialog("option","title","Reject Document");
	 }
	});
</script>
<form:form commandName="documentWorkFlowForm" id="workFlowForm">
<table class="zeroBorder " style="width: 100%; height: 100%;">
	<tr class="formSpacingRow"><td colspan="9"></td></tr>
	<tr>
		<td class="formLabel"><label>Remarks</label> </td>
		<td class="spacingColumnWidthMedium"></td>
		<td class="formField">
			<input type="hidden" value="${currentWfId}" name="currentWfId" id="currentWfId">
			<input type="hidden" value="${docId}" name="docId" id="docId">
			<form:textarea path="remarks" id="remarks" cssClass="text" /> 
		</td>
	</tr>
	<tr>
		<td class="spacingColumn"></td>
		<td class="spacingColumnWidthMedium"></td>
		<td>
			<form:errors path="remarks" cssClass="text errorMsg"></form:errors>
		</td>
	</tr>
	<tr class="formSpacingRow "><td colspan="3"></td></tr>
	<tr>
	<td class="spacingColumn"></td>

	<td colspan="3" align="center"> 
		<c:choose>
			<c:when test="${fn:contains(workflowActionType,'approve')}">
				<input type="button" class="formButton" value="Submit" onclick="approveOrRejectDocument('workFlowForm','submit')">		
			</c:when>
			<c:otherwise>
				 <input type="button" class="formButton" value="Reject" onclick="approveOrRejectDocument('workFlowForm','reject')">
			</c:otherwise>
		</c:choose>
			 &nbsp;<input type="button" class="formButton" value="Cancel" onclick="closeCurrentDialog()">
		</td>
		
	</tr>
	
</table>
</form:form>	

